<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionController::TestProcess</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionController::TestProcess</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_controller/test_process_rb.html">
                vendor/rails/actionpack/lib/action_controller/test_process.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000194">assigns</a>&nbsp;&nbsp;
      <a href="#M000199">build_request_uri</a>&nbsp;&nbsp;
      <a href="#M000197">cookies</a>&nbsp;&nbsp;
      <a href="#M000202">find_all_tag</a>&nbsp;&nbsp;
      <a href="#M000201">find_tag</a>&nbsp;&nbsp;
      <a href="#M000204">fixture_file_upload</a>&nbsp;&nbsp;
      <a href="#M000196">flash</a>&nbsp;&nbsp;
      <a href="#M000193">follow_redirect</a>&nbsp;&nbsp;
      <a href="#M000200">html_document</a>&nbsp;&nbsp;
      <a href="#M000189">included</a>&nbsp;&nbsp;
      <a href="#M000203">method_missing</a>&nbsp;&nbsp;
      <a href="#M000190">process</a>&nbsp;&nbsp;
      <a href="#M000198">redirect_to_url</a>&nbsp;&nbsp;
      <a href="#M000195">session</a>&nbsp;&nbsp;
      <a href="#M000205">with_routing</a>&nbsp;&nbsp;
      <a href="#M000192">xhr</a>&nbsp;&nbsp;
      <a href="#M000191">xml_http_request</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000189" class="method-detail">
        <a name="M000189"></a>

        <div class="method-heading">
          <a href="#M000189" class="method-signature">
          <span class="method-name">included</span><span class="method-args">(base)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000189-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 359</span>
359:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>)
360:       <span class="ruby-comment cmt"># execute the request simulating a specific http method and set/volley the response</span>
361:       <span class="ruby-node">%w( get post put delete head )</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
362:         <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def \#{method}(action, parameters = nil, session = nil, flash = nil)\n@request.env['REQUEST_METHOD'] = \&quot;\#{method.upcase}\&quot; if defined?(@request)\nprocess(action, parameters, session, flash)\nend\n&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>
363:       <span class="ruby-keyword kw">end</span>
364:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000194" class="method-detail">
        <a name="M000194"></a>

        <div class="method-heading">
          <a href="#M000194" class="method-signature">
          <span class="method-name">assigns</span><span class="method-args">(key = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000194-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 416</span>
416:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assigns</span>(<span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>) 
417:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">nil?</span> 
418:         <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">template</span>.<span class="ruby-identifier">assigns</span> 
419:       <span class="ruby-keyword kw">else</span> 
420:         <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">template</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] 
421:       <span class="ruby-keyword kw">end</span> 
422:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000199" class="method-detail">
        <a name="M000199"></a>

        <div class="method-heading">
          <a href="#M000199" class="method-signature">
          <span class="method-name">build_request_uri</span><span class="method-args">(action, parameters)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000199-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000199-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 440</span>
440:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_request_uri</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>)
441:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'REQUEST_URI'</span>]
442:         <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">:rewrite_options</span>, <span class="ruby-identifier">parameters</span>)
443:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">:only_path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>)
444: 
445:         <span class="ruby-identifier">url</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">UrlRewriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-identifier">parameters</span>)
446:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">set_REQUEST_URI</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">options</span>))
447:       <span class="ruby-keyword kw">end</span>
448:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000197" class="method-detail">
        <a name="M000197"></a>

        <div class="method-heading">
          <a href="#M000197" class="method-signature">
          <span class="method-name">cookies</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000197-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 432</span>
432:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cookies</span>
433:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">cookies</span>
434:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000202" class="method-detail">
        <a name="M000202"></a>

        <div class="method-heading">
          <a href="#M000202" class="method-signature">
          <span class="method-name">find_all_tag</span><span class="method-args">(conditions)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000202-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000202-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 459</span>
459:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_all_tag</span>(<span class="ruby-identifier">conditions</span>)
460:       <span class="ruby-identifier">html_document</span>.<span class="ruby-identifier">find_all</span>(<span class="ruby-identifier">conditions</span>)
461:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000201" class="method-detail">
        <a name="M000201"></a>

        <div class="method-heading">
          <a href="#M000201" class="method-signature">
          <span class="method-name">find_tag</span><span class="method-args">(conditions)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000201-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000201-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 455</span>
455:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_tag</span>(<span class="ruby-identifier">conditions</span>)
456:       <span class="ruby-identifier">html_document</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">conditions</span>)
457:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000204" class="method-detail">
        <a name="M000204"></a>

        <div class="method-heading">
          <a href="#M000204" class="method-signature">
          <span class="method-name">fixture_file_upload</span><span class="method-args">(path, mime_type = nil, binary = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Shortcut for <a
href="TestUploadedFile.html#M000463">ActionController::TestUploadedFile.new</a>(Test::Unit::TestCase.fixture_path
+ path, type). Example:
</p>
<pre>
  post :change_avatar, :avatar =&gt; fixture_file_upload('/files/spongebob.png', 'image/png')
</pre>
<p>
To upload binary files on Windows, pass :binary as the last parameter. This
will not affect other platforms.
</p>
<pre>
  post :change_avatar, :avatar =&gt; fixture_file_upload('/files/spongebob.png', 'image/png', :binary)
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000204-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000204-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 473</span>
473:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fixture_file_upload</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">mime_type</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">binary</span> = <span class="ruby-keyword kw">false</span>)
474:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">TestUploadedFile</span>.<span class="ruby-identifier">new</span>(
475:         <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fixture_path</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Unit</span><span class="ruby-operator">::</span><span class="ruby-constant">TestCase</span>.<span class="ruby-identifier">fixture_path</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">path</span>, 
476:         <span class="ruby-identifier">mime_type</span>,
477:         <span class="ruby-identifier">binary</span>
478:       )
479:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000196" class="method-detail">
        <a name="M000196"></a>

        <div class="method-heading">
          <a href="#M000196" class="method-signature">
          <span class="method-name">flash</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000196-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 428</span>
428:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flash</span>
429:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">flash</span>
430:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000193" class="method-detail">
        <a name="M000193"></a>

        <div class="method-heading">
          <a href="#M000193" class="method-signature">
          <span class="method-name">follow_redirect</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000193-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000193-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 407</span>
407:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">follow_redirect</span>
408:       <span class="ruby-identifier">redirected_controller</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">redirected_to</span>[<span class="ruby-identifier">:controller</span>]
409:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">redirected_controller</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">redirected_controller</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">controller_name</span>
410:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Can't follow redirects outside of current controller (from #{@controller.controller_name} to #{redirected_controller})&quot;</span>
411:       <span class="ruby-keyword kw">end</span>
412: 
413:       <span class="ruby-identifier">get</span>(<span class="ruby-ivar">@response</span>.<span class="ruby-identifier">redirected_to</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:action</span>), <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">redirected_to</span>.<span class="ruby-identifier">stringify_keys</span>)
414:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000200" class="method-detail">
        <a name="M000200"></a>

        <div class="method-heading">
          <a href="#M000200" class="method-signature">
          <span class="method-name">html_document</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000200-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000200-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 450</span>
450:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">html_document</span>
451:       <span class="ruby-identifier">xml</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">content_type</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/xml$/</span>
452:       <span class="ruby-ivar">@html_document</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">HTML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@response</span>.<span class="ruby-identifier">body</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">xml</span>)
453:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000203" class="method-detail">
        <a name="M000203"></a>

        <div class="method-heading">
          <a href="#M000203" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(selector, *args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000203-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 463</span>
463:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
464:       <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">named_routes</span>.<span class="ruby-identifier">helpers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">selector</span>)
465:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">super</span>
466:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000190" class="method-detail">
        <a name="M000190"></a>

        <div class="method-heading">
          <a href="#M000190" class="method-signature">
          <span class="method-name">process</span><span class="method-args">(action, parameters = nil, session = nil, flash = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
execute the request and set/volley the response
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000190-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 373</span>
373:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">session</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">flash</span> = <span class="ruby-keyword kw">nil</span>)
374:       <span class="ruby-comment cmt"># Sanity check for required instance variables so we can give an</span>
375:       <span class="ruby-comment cmt"># understandable error message.</span>
376:       <span class="ruby-node">%w(@controller @request @response)</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">iv_name</span><span class="ruby-operator">|</span>
377:         <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">iv_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">iv_name</span>.<span class="ruby-identifier">to_sym</span>)) <span class="ruby-operator">||</span> <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">iv_name</span>).<span class="ruby-identifier">nil?</span>
378:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{iv_name} is nil: make sure you set it in your test's setup method.&quot;</span>
379:         <span class="ruby-keyword kw">end</span>
380:       <span class="ruby-keyword kw">end</span>
381: 
382:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">recycle!</span>
383: 
384:       <span class="ruby-ivar">@html_document</span> = <span class="ruby-keyword kw">nil</span>
385:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'REQUEST_METHOD'</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;GET&quot;</span>
386:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>
387: 
388:       <span class="ruby-identifier">parameters</span> <span class="ruby-operator">||=</span> {}
389:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">assign_parameters</span>(<span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">controller_path</span>, <span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">parameters</span>)
390: 
391:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">session</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">TestSession</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">session</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">session</span>.<span class="ruby-identifier">nil?</span>
392:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">session</span>[<span class="ruby-value str">&quot;flash&quot;</span>] = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Flash</span><span class="ruby-operator">::</span><span class="ruby-constant">FlashHash</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">flash</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flash</span>
393:       <span class="ruby-identifier">build_request_uri</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>)
394:       <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">process</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span>)
395:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000198" class="method-detail">
        <a name="M000198"></a>

        <div class="method-heading">
          <a href="#M000198" class="method-signature">
          <span class="method-name">redirect_to_url</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000198-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 436</span>
436:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect_to_url</span>
437:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">redirect_url</span>
438:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000195" class="method-detail">
        <a name="M000195"></a>

        <div class="method-heading">
          <a href="#M000195" class="method-signature">
          <span class="method-name">session</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000195-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 424</span>
424:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
425:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">session</span>
426:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000205" class="method-detail">
        <a name="M000205"></a>

        <div class="method-heading">
          <a href="#M000205" class="method-signature">
          <span class="method-name">with_routing</span><span class="method-args">() {|temporary_routes| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A helper to make it easier to test different route configurations. This
method temporarily replaces ActionController::Routing::Routes with a new
RouteSet instance.
</p>
<p>
The new instance is yielded to the passed block. Typically the block will
create some routes using map.draw { map.connect &#8230; }:
</p>
<pre>
 with_routing do |set|
   set.draw do |map|
     map.connect ':controller/:action/:id'
       assert_equal(
         ['/content/10/show', {}],
         map.generate(:controller =&gt; 'content', :id =&gt; 10, :action =&gt; 'show')
     end
   end
 end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000205-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000205-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 498</span>
498:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_routing</span>
499:       <span class="ruby-identifier">real_routes</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>
500:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">remove_const</span> <span class="ruby-identifier">:Routes</span> }
501: 
502:       <span class="ruby-identifier">temporary_routes</span> = <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">RouteSet</span>.<span class="ruby-identifier">new</span>
503:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">const_set</span> <span class="ruby-identifier">:Routes</span>, <span class="ruby-identifier">temporary_routes</span> }
504: 
505:       <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">temporary_routes</span>
506:     <span class="ruby-keyword kw">ensure</span>
507:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-identifier">:Routes</span>
508:         <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">remove_const</span> <span class="ruby-identifier">:Routes</span> }
509:       <span class="ruby-keyword kw">end</span>
510:       <span class="ruby-constant">ActionController</span><span class="ruby-operator">::</span><span class="ruby-constant">Routing</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-identifier">:Routes</span>, <span class="ruby-identifier">real_routes</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">real_routes</span>
511:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000192" class="method-detail">
        <a name="M000192"></a>

        <div class="method-heading">
          <span class="method-name">xhr</span><span class="method-args">(request_method, action, parameters = nil, session = nil, flash = nil)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="TestProcess.html#M000191">xml_http_request</a>
</p>
        </div>
      </div>

      <div id="method-M000191" class="method-detail">
        <a name="M000191"></a>

        <div class="method-heading">
          <a href="#M000191" class="method-signature">
          <span class="method-name">xml_http_request</span><span class="method-args">(request_method, action, parameters = nil, session = nil, flash = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000191-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 397</span>
397:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_http_request</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">session</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">flash</span> = <span class="ruby-keyword kw">nil</span>)
398:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>] = <span class="ruby-value str">'XMLHttpRequest'</span>
399:       <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>[<span class="ruby-value str">'HTTP_ACCEPT'</span>] = <span class="ruby-value str">'text/javascript, text/html, application/xml, text/xml, */*'</span>
400:       <span class="ruby-identifier">returning</span> <span class="ruby-identifier">send!</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">session</span>, <span class="ruby-identifier">flash</span>) <span class="ruby-keyword kw">do</span>
401:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'HTTP_X_REQUESTED_WITH'</span>
402:         <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">'HTTP_ACCEPT'</span>
403:       <span class="ruby-keyword kw">end</span>
404:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>